import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
  path: '/main',
  name: 'main',
  meta,
  redirect: { name: 'main-home' },
  component: layoutHeaderAside,
  children: [
    {
      path: 'home',
      name: 'main-home',
      component: _import('main/home'),
      meta: {
        ...meta,
        title: '工作台'
      }
    },
    {
      path: 'task_list',
      name: 'main-task-list',
      component: _import('main/task_list'),
      meta: {
        ...meta,
        title: '任务列表'
      }
    },
    {
      path: 'measure',
      name: 'main-measure',
      component: _import('main/measure'),
      meta: {
        ...meta,
        title: '计量业务看板'
      }
    },
    {
      path: 'composite',
      name: 'main-composite',
      component: _import('main/composite'),
      meta: {
        ...meta,
        title: '综合类看板'
      }
    }
  ]
}
